#ifndef CACHE_TYPES_H
#define CACHE_TYPES_H

enum CacheAccess {
	CACHE_ERROR,
	CACHE_HIT_TOP     = 0x10,
	CACHE_HIT_PUSH    = 0x11,
	CACHE_HIT_DELAYED = 0x12,
	CACHE_HIT_ICACHE  = 0x13,
	CACHE_MISS_NEW    = 0x20,
	CACHE_MISS_EVICT  = 0x21,
	CACHE_MISS_EVICT_DIRTY  = 0x22,
};

static inline bool
CacheAccessIsHit(CacheAccess access)
{
  return ((access & 0x20) == 0);
}
static inline bool
CacheAccessIsDirty(CacheAccess access)
{
  return (access & CACHE_MISS_EVICT_DIRTY);
}

static inline bool
CacheAccessIsMissNew(CacheAccess access)
{
  return (access & CACHE_MISS_NEW);
}

static inline bool
CacheAccessIsEvict(CacheAccess access)
{
  return (access == CACHE_MISS_EVICT || access == CACHE_MISS_EVICT_DIRTY);
}

static inline bool
CacheAccessIsHitInvalidate(CacheAccess access)
{
  return (access & CACHE_HIT_ICACHE);
}



#endif
